package com.hys.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
@ApiModel("合作内容")
public class CooperContentParam {

    @ApiModelProperty("是否开发课程")
    private Boolean isCoDevCourse;

    @ApiModelProperty("课程数量")
    private Integer courseCount;

    @ApiModelProperty("课程名称")
    @Length(max = 5000, message = "课程名称最大长度不得超过5000个字符")
    private String courseName;

    @ApiModelProperty("是否共建教材")
    private Boolean isCoBuildBook;

    @ApiModelProperty("教材总数")
    private Integer bookKind;

    @ApiModelProperty("教材名称")
    @Length(max = 5000, message = "教材名称最大长度不得超过5000个字符")
    private String bookName;

    @ApiModelProperty("参与指导/组织技能学生竞赛名称")
    @Length(max = 50, message = "参与指导/组织技能学生竞赛名称 最大长度不得超过50个字符")
    private String joinMatchName;

    @ApiModelProperty("支持学校行业导师人数")
    private Integer supportSchoolNum;

    @ApiModelProperty("订单培养数")
    private Integer orderNum;

    @ApiModelProperty("是否开展学徒制")
    private Boolean isApprentice;

    @ApiModelProperty("共建产教实训基地")
    @Length(max = 50, message = "共建产教实训基地最大长度不得超过50个字符")
    private String trainingBase;

    @ApiModelProperty("学校为企业年培训员工数")
    private Integer orderForEnterNum;

    @ApiModelProperty("是否有合作成效")
    private Boolean isCoopEffect;

    @ApiModelProperty("技术开发")
    private Double teachDev;

    @ApiModelProperty("技术转让")
    private Double teachMakeOver;

    @ApiModelProperty("技术许可")
    private Double teachPermission;

    @ApiModelProperty("技术咨询")
    private Double teachConsult;

    @ApiModelProperty("技术服务")
    private Double teachService;

    @ApiModelProperty("发明专利")
    private Integer patentDevelop;

    @ApiModelProperty("实用新型专利")
    private Integer patentPractical;

    @ApiModelProperty("外观设计专利")
    private Integer patentAspect;

    @ApiModelProperty("软件著作权")
    private Integer softCopyRight;

    @ApiModelProperty("纵向项目数")
    private Integer projectNumber;

    /**
     * 设置默认值
     */
    public void setIsDefault(){
        if(isCoDevCourse == null ){
            isCoDevCourse = true;
        }
        if(isCoBuildBook == null){
            isCoBuildBook = true;
        }
        if(isApprentice == null){
            isApprentice = true;
        }
        if(isCoopEffect == null){
            isCoopEffect = true;
        }
    }


    /**
     * 当选择为否的时候清空属性
     */
    public void delWhenBooleanIsFalse() {

        if(isCoDevCourse == false){
            this.courseCount = null;
            this.courseName = null;
        }
        if(isCoBuildBook == false){
            this.bookKind = null;
            this.bookName = null;
            this.joinMatchName = null;
            this.supportSchoolNum = null;
            this.orderNum = null;
        }
        if(isApprentice == false){
            this.trainingBase = null;
            this.orderForEnterNum = null;
        }
        if(isCoopEffect == false){
            this.teachDev = null;
            this.teachMakeOver = null;
            this.teachPermission = null;
            this.teachConsult = null;
            this.teachService = null;
            this.patentDevelop = null;
            this.patentPractical = null;
            this.patentAspect = null;
            this.softCopyRight = null;
            this.projectNumber = null;
        }
    }
}
